package com.shensi.adminCollect.mapper.station;

import com.shensi.adminCollect.domain.station.*;
import com.shensi.adminCollect.domain.station.dto.DivideAccountsSettingDto;
import com.shensi.adminCollect.domain.station.dto.RegionalReportDto;
import com.shensi.adminCollect.domain.station.form.PayOrderDetailQueryForm;
import com.shensi.adminCollect.domain.station.form.PayOrderEmployeeQueryForm;
import com.shensi.adminCollect.domain.station.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 订单支付Mapper接口
 *
 * @author qujia
 * @date 2020-12-10
 */
@Repository
public interface PayOrderMapper
{
    /**
     * 查询订单支付
     *
     * @param orderId 订单支付ID
     * @return 订单支付
     */
    public PayOrder selectPayOrderById(Long orderId);

    PayOrder selectPayOrderByOrdNo(String orderNo);

    void insertOrderAmountModificationLog(OrderAmountModificationLog log);
    /**
     * 批量删除
     * @param list
     * @return
     */

    public  int deletePay(List<Long> list);
    /**
     * 修改一段时间内的订单的金额
     *
     * @param paramMap 参数Map
     */
    void updatePayOrderAmt(Map<String, Object> paramMap);
    /**
     * 查询订单支付
     *
     * @param orderId 订单支付ID
     * @return 订单支付
     */
    public PayOrder selectPayOrderForFeiEById(Long orderId);

    /**
     * 查询订单支付
     *
     * @param merchantsNumber 订单支付ID
     * @return 订单支付
     */
    public PayOrder selectOrderInfoByMerchantsNumber(String merchantsNumber);

    /**
     * 查询订单支付列表
     *
     * @param payOrder 订单支付
     * @return 订单支付集合
     */
    public List<PayOrder> selectPayOrderListUserPaytime(PayOrder payOrder);


    public List<DivideAccounts> queryDivideAccountsList(DivideAccounts divideAccounts);

    public List<DivideAccountsSettingDto> queryDivideSettingList(DivideAccountsSettingDto divideAccountsSettingDto);


    public List<DivideAccounts> selectDivideAccountsDetail(String uuid);

    public List<DivideAccountsSettingDto> selectDivideSettingDetail(@Param("beginMmo") String beginMmo,@Param("stationId") String stationId);

    public int updateDivideSettingStatus(DivideAccountsSettingDto divideAccountsSettingDto);


    /**
     * 查询订单支付列表
     *
     * @param payOrder 订单支付
     * @return 订单支付集合
     */
    public List<PayOrder> selectPayOrderList(PayOrder payOrder);

    public int creationDivideSetting(DivideAccountsSettingDto divideAccountsSettingDto);

    public int deleteByBeginMmo(@Param("beginMmo") String beginMmo, @Param("stationId") String stationId);

    public Integer selectByBeginMmo(@Param("beginMmo") String beginMmo, @Param("stationId") String stationId);

    /**
     * 查询所有订包括未支付的订单
     *
     * @param payOrder 订单支付
     * @return 订单支付集合
     */
    public List<PayOrder> selectAllPayOrderList(PayOrder payOrder);

    public PayOrder homePaymentSumQuery(PayOrder payOrder);



    public List<PayOrder> homeSevenSumQuery(PayOrder payOrder);

    /**
     * 查总数
     *
     *
     * @return 结果
     */
    public int countByStatus(PayOrder payOrder) ;


    /**
     * 查询订单统计量
     *
     * @param payOrder 订单支付
     * @return 订单支付集合
     */
    public List<StatisticsPayOrder> selectStatisticsPayOrderList(PayOrder payOrder);


    /**
     * 通过油品统计信息
     *
     * @param payOrder 订单支付
     * @return 订单支付集合
     */
    public List<OilPayOrderSum> selectOilPayOrderSum(PayOrder payOrder);

    /**
     * 通过油品统计信息
     *
     * @param payOrder 订单支付
     * @return 订单支付集合
     */
    public OilPayOrderSum selectOilPayOrderAllSum(PayOrder payOrder);


    /**
     * 查询订单合计信息
     *
     * @param payOrder 订单支付
     * @return 订单支付集合
     */
    public StatisticsPayOrder selectStatisticsPayOrderSum(PayOrder payOrder);



    /**
     * 小程序查询汇总订单
     *
     * @param payOrder 订单支付
     * @return 汇总信息
     */
    public PayOrder selectAppletPayOrderSum(PayOrder payOrder);

    /**
     * 新增订单支付
     *
     * @param payOrder 订单支付
     * @return 结果
     */
    public int insertPayOrder(PayOrder payOrder);

    /**
     * 新增订单支付forStar
     *
     * @param payOrder 繁星订单支付
     * @return 结果
     */
    public int insertPayOrderForStar(PayOrder payOrder);

    /**
     * 修改订单支付
     *
     * @param payOrder 订单支付
     * @return 结果
     */
    public int updatePayOrder(PayOrder payOrder);


    public String selectPayOrderByOrderNo(PayOrder payOrder);

    public int updatePayOrderByOrderNo(PayOrder payOrder);

    public int updatePayOrderByOrderNoForStar(PayOrder payOrder);



    /**
     * 删除订单支付
     *
     * @param orderId 订单支付ID
     * @return 结果
     */
    public int deletePayOrderById(Long orderId);

    /**
     * 批量删除订单支付
     *
     * @param orderIds 需要删除的数据ID
     * @return 结果
     */
    public int deletePayOrderByIds(Long[] orderIds);

    /**
     * 汇总今天销售金额，销售量
     * @param payOrder
     * @return
     */
    public PayOrder selectDaySources(PayOrder payOrder);

    /**
     * 汇总所有的订单信息
     * @param payOrder
     * @return
     */
    public PayOrder selectAllDaySources(PayOrder payOrder);


    /**
     * 汇总订单统计信息
     * @param payOrder
     * @return
     */
    public PayOrder selectSumPayOrder(PayOrder payOrder);

    /**
     * 根据油品分类获取数据
     * @param payOrder
     * @return
     */
    public  List<PayOrder> selectOilTypeSources(PayOrder payOrder);

    /**
     * 根据油品分类获取所有数据
     * @param payOrder
     * @return
     */
    public  List<PayOrder> selectAllOilTypeSources(PayOrder payOrder);

    /**
     * 收入概览
     * @param payOrder
     * @return
     */
    public PayOrder selectOverViewData(PayOrder payOrder);
    /**
     * 收入概览（包括退款的）
     * @param payOrder
     * @return
     */
    public PayOrder selectAllOverViewData(PayOrder payOrder);

    /**
     * 月报数据
     * @param payOrder
     * @return
     */
    public List<PayOrder> selectDayReport(PayOrder payOrder);


    /**
     * 月报数据(包括已经退款的)
     * @param payOrder
     * @return
     */
    public List<PayOrder> selectAllDayReport(PayOrder payOrder);

    /**
     * 用于历史数据日报
     * 月报数据(包括已经退款的)
     * @param payOrder
     * @return
     */
    public List<PayOrder> selectNewAllDayReport(PayOrder payOrder);

    /**
     * 日报折线图获取油品数据
     * @param payOrder
     * @return
     */
    public List<PayOrder> listQydata(PayOrder payOrder);
    /**
     * 获取x轴数据
     * @param payOrder
     * @param payOrder
     * @return
     */
    public List<PayOrder> listXdata(PayOrder payOrder);
    /**
     * 查询导出信息
     * @param payOrder
     * @return
     */
    public List<PayOrder> selectPayOrderExport(PayOrder payOrder);

    /**
     * 查询数据，根据员工汇总数据
     * @param payOrder
     * @return
     */
    public List<PayOrder> selectPersonnelStructure(PayOrder payOrder);

    /**
     * 查询数据，根据员工汇总数据
     * @param payOrder
     * @return
     */
    public List<PayOrder> selectOilStructure(PayOrder payOrder);

    /**
     * 初始化数据班结数据，根据员工/支付方式汇总
     * @param payOrder
     * @return
     */
    public List<PayOrder> selectPersonnelPayStructure(PayOrder payOrder);

    /**
     * 查询油站第一笔订单的数据
     */
    public  PayOrder getPayOrderInfoMin(PayOrder payOrder);

    /**
     * 日报数据详情
     * @param payOrder
     * @return
     */
    public List<PayOrder> dayOilTypeSources(PayOrder payOrder);

    /**
     * 日报数据详情(包括已退款)
     * @param payOrder
     * @return
     */
    public List<PayOrder> dayAllOilTypeSources(PayOrder payOrder);

    /**
     * 查询lNG数据
     * @param payOrder
     * @return
     */
    public List<PayOrder> selectLNGPayOrderExport(PayOrder payOrder);

    public List<PayOrder> LNGDeptList(PayOrder payOrder);

    /**
     * 用戶信息关联订单查询
     * @param payOrder
     * @return
     */
    public List<PayOrder> selectUserPayOrderList(PayOrder payOrder);



    /**
     * 转移历史订单
     *
     *
     * @return 结果
     */
    public int chengePayOrderToHistory();

    List<PayOrderEmployeeQueryVo> selectPayOrderEmployeeList(PayOrderEmployeeQueryForm payOrderEmployeeQueryForm);

    PayOrderEmployeeQueryVo selectPayOrderEmployeeStatistics(PayOrderEmployeeQueryForm payOrderEmployeeQueryForm);

    List<PayOrderEmployeeQueryVo> selectAllPayOrderEmployeeList(PayOrderEmployeeQueryForm payOrderEmployeeQueryForm);

    List<PayOrderDetailQueryVo> selectPayOrderDetailList(PayOrderDetailQueryForm payOrderDetailQueryForm);

    List<PayOrderDetailQueryVo> selectAllPayOrderDetailList(PayOrderDetailQueryForm payOrderDetailQueryForm);

    //根据订单号查询订单
    PayOrder selectOrderInfoByOrdNo(String orderNo);

    void updatePayOrderPrintStatus(String orderNo);

    List<PayOrder> selectCdkPayOrderList(PayOrder payOrder);

    List<PayOrder> selectNewCdkPayOrderList(PayOrder payOrder);

    List<PayOrder> selectOldCdkPayOrderList(PayOrder payOrder);

    List<PayOrder> selectCdkPayHisOrderList(PayOrder payOrder);

    List<StatisticsPayOrder> newSelectStatisticsPayOrderList(PayOrder payOrder);

    StatisticsPayOrder newSelectStatisticsPayOrderSum(PayOrder payOrder);

    List<PayOrder> selectPayOrderAndHisPayOrderList(PayOrder payOrder);

    List<ReductionRulesVo> selectReductionRulesList(ReductionRulesVo reductionRules);

    List<ReductionActivitiesAmtVO> selectReductionActivityStationId(ReduActiVO reduActiVO);

    //根据外部订单号查询订单
    PayOrder selectOrderByOutOrderNo(String outOrderNo);

    List<StatisticsPayOrder> selectRegionalReport(RegionalReportDto regionalReportDto);

    // 首页查询油品销售数量
    List<PayOrder> getOilSaleNumList(PayOrder payOrder);

    //查询订单
    List<YunHuaOrderInfo> getOrderListByDate(String createDate);

    void deleteReductionActivityLogByOrderId(Long orderId);

    List<PayOrder> getPayOrderListByOrderMergeNo(String orderMergeNo);
}
